In general, a program (synonymous with source codes herein) depends on any device (CPU and periphery equipment), middleware such as OS, and a library. For example, an instruction set designed for exclusive use for a particular CPU does not work with another CPU that does not support the instruction set. Similarly, a program that depends on a particular OS and library does not work with another OS and another library that are not compatible with the OS and library. This may pose a problem when porting a program from an execution environment to another execution environment. The reason is that, if portions dependent on a particular execution environment (hereinafter simply referred to as environment-dependent portions), existing within a program, exist everywhere in the program, there is an increase in man-hours for modification when porting the program to another execution environment.
As a method for avoiding this problem a method of gathering (localizing) environment-dependent portions which exist, distributed within a program into one file (source file) is commonly used. Gathering environment-dependent portions existing within a program into one file enables confining segments subject to modification and minimizing man-hours for modification.
However, it is often the case that, in the beginning of developing a program, porting the program to another execution environment is not foreseen. Alternatively, even in a case where, in the beginning of development, porting a program to another environment is foreseen and a design to localize environment-dependent portions was adopted, environment-dependent portions may sometimes be distributed to diverse files along with advance of the development. To enhance portability of such a program, it is desirable to identify environment-dependent portions distributed within the program and localize environment-dependent portions.
As a tool to identify environment-dependent portions distributed within a program, there is, inter alia, a MISRA-C rule checker; this is a coding guideline for C language developed by MISRA (an abbreviation of Motor Industry Software Reliability Association, a registered trademark). MISRA-C is a coding guideline intended to ensure the safety, portability, and reliability of programs and includes a variety of rules to identify environment-dependent portions. There is also a technology for extracting microcomputer-dependent portions by estimating a variable to store an address in hexadecimal notation as a hardware register variable, e.g., as in Patent Literature (PTL) 1.